#define _CRT_SECURE_NO_WARNINGS   1

#include<iostream>
#include<map>
#include<cstdio>
#include<cstring>
#include<string.h>
#include<string>

using namespace std;

const int DirX[4] = { 10, 0, -10, 0 };
const int DirY[4] = { 0, 10, 0, -10 };

#define mp make_pair;

int N, M, Shoot;
int x[1050], y[1050], d[1050];
bool run[1050], die[1050];
string symbol[1050];

map<string, int>Name;

void Init()
{
	Name.clear();
	for (int i = 1; i <= N; i++)
	{
		cin >> symbol[i] >> x[i] >> y[i] >> d[i];
		x[i] *= 6;
		y[i] *= 6;
		d[i] /= 90;
		run[i] = false;
		die[i] = false;
		Name[symbol[i]] = i;
	}
	Shoot = N;
}

bool In(int x, int y)
{
	if (x >= 0 && x <= 6 * 120 && y >= 0 && y <= 6 * 120)
		return true;
	else
		return false;
}

void RunAll()
{
	for (int i = 1; i <= N; i++)
	{
		if (run[i] && !die[i])
		{
			if (In(x[i] + DirX[d[i]], y[i] + DirY[d[i]]))
			{
				x[i] += DirX[d[i]];
				y[i] += DirY[d[i]];
			}
			else
				run[i] = false;
		}
	}
	for (int i = N + 1; i <= Shoot; i++)
	{
		if (!die[i])
		{
			if (In(x[i] + DirX[d[i]] * 2, y[i] + DirY[d[i]] * 2))
			{
				x[i] += DirX[d[i]] * 2;
				y[i] += DirY[d[i]] * 2;
			}
			else
				die[i] = true;
		}
	}
	for (int i = 1; i <= N; i++)
	{
		if (die[i])
			continue;
		for (int j = N + 1; j <= Shoot; j++)
		if (!die[j])
		{
			if (x[i] == x[j] && y[i] == y[j])
			{
				die[j] = true;
				die[i] = true;
			}
		}
	}
}

void Slove()
{
	int now = 0;
	for (int i = 1; i <= M; i++)
	{
		int t;
		string sym, s;
		int th;
		cin >> t >> sym >> s;
		t *= 6;
		while (t > now)
		{
			RunAll();
			now++;
		}

		int symId = Name[sym];
		if (s == "MOVE")
		{
			run[symId] = true;
		}
		else if (s == "STOP")
		{
			run[symId] = false;
		}
		else if (s == "SHOOT")
		{
			if (!die[symId])
			{
				Shoot++;
				run[Shoot] = true;
				die[Shoot] = false;
				d[Shoot] = d[symId];
				x[Shoot] = x[symId];
				y[Shoot] = y[symId];
			}
		}
		else
		{
			cin >> th;
			th /= 90;
			d[symId] = (d[symId] + (th % 4) + 4) % 4;
		}
	}
	for (int i = 1; i <= 15 * 6; i++)
		RunAll();
	int cnt = 0;
	for (int i = 1; i <= N; i++)
	if (!die[i])
		cnt++;
	if (cnt != 1)
		cout << "NO WINNER!" << endl;
	else
	{
		for (int i = 1; i <= N;i++)
		if (!die[i])
			cout << symbol[i] << endl;
	}
}

int main()
{
	while (cin >> N >> M && (N || M))
	{
		Init();
		Slove();
	}
}